<?php $this->pageTitle = 'Payable Items Summary'; ?>
<?php Yii::app()->clientScript->registerScriptFile('/js/jquery.cookie/jquery.cookie.js'); ?>

<div class="flat_area">
    <div class="grid_16 content_header clearfix">
        <h1 class="float-left">Totals for Payable Items <i>(currently not assigned to payment vouchers)</i> </h1>
    </div>
    <div class="grid_16 relative">

        <div id="ps-payable-items-summary-index" class="box">
            <h2 class="box_head grad_colour with-icon"><img width="16" height="16" src="/images/icons/fugue/folder.png" /><?= ucwords($viewName); ?> Agents</h2>
			<?php
			$this->widget('PsGridView', array(
				'id' => 'agents-index-grid',
				'dataProvider' => $dataProvider,
				'template' => '{items}{pager}{pagesize}',
				'emptyText' => $emptyText,
				'htmlOptions' => array(
					'class' => 'grid-view grey'
				),
				'pagerCssClass' => 'pager float-right',
				'pagesizeCssClass' => 'pager-pagesize float-right',
				'columns' => array(
					array(
						'header' => 'Salesperson Name',
						'name' => 'name',
						'htmlOptions' => array(
							'width' => 100
						)
					),
					array(
						'header' => 'Total',
						'name' => 'payment_items_total',
						'type' => 'raw',
						'value' => 'Yii::app()->numberFormatter->formatCurrency($data->payment_items_total, "$ ")',
						'htmlOptions' => array(
							'width' => 170
						)
					),
					array(
						'header' => 'Action',
						'type' => 'raw',
						'value' => 'CHtml::link("<img src=\'/images/icons/fugue/magnifier-zoom-in.png\' /> View Details", 
							array("paymentVoucher/outstandingDetails","id" => $data->id))',
						'htmlOptions' => array(
							'width' => 170
						)
					)
//					array(
//						'header' => 'Actions',
//						'class' => 'common.widgets.grid.PsActionColumn', // protected/components/PsActionColumn.php
//						'htmlOptions' => array(
//							'class' => 'action-column',
//							'width' => 80,
//						),
//						'options' => array(
//							'width' => 120,
//						),
//						'actions' => array(
//							'view' => array(
//								'label' => 'Create Payment Voucher',
//								'icon' => '/images/icons/fugue/magnifier-zoom-in.png',
//								'url' => array('paymentVoucher/outstandingDetails', 'id' => '$data->id'),
//							),
//						)
//					),
				),
			));
			?>

        </div>
		<!--        <div>
		<?php if (!$showDeleted): ?>
												<a class="float-left blue link" href="<?php echo $this->createUrl('paymentVoucher/index', array('showDeleted' => true, 'view' => $view)); ?>">Show Cancelled</a>
		<?php else: ?>
												<a class="float-left blue link" href="<?php echo $this->createUrl('paymentVoucher/index', array('view' => $view)); ?>">Hide Cancelled</a>
		<?php endif; ?>
				</div>-->


		<div class="content_header_controls">
			<a id="back" class="link-button with-icon" href="<?php echo $this->createUrl('paymentVoucher/index'); ?>">
				<img src="/images/icons/fugue/ui-button-navigation-back.png" />
				Back to Payment Vouchers
			</a>
        </div>
    </div>
</div>
<script type="text/javascript">
    var welcomePopupEnabled = <?php echo ($welcomePopupEnabled ? "true" : "false"); ?>;
    var showWhatsNew = <?php echo ($showWhatsNew ? "true" : "false"); ?>;
</script>